USE [OctoNetApps]
GO

/****** Object:  Table [classified].[ClassifiedAdsCustomAttributeValues]    Script Date: 05/25/2011 06:50:23 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [classified].[ClassifiedAdsCustomAttributeValues](
	[ResourceID] [bigint] NOT NULL,
	[CategoryID] [bigint] NOT NULL,
	[AdID] [bigint] NOT NULL,
	[AttributeID] [bigint] NOT NULL,
	[AttributeValueName] [nvarchar](250) NULL,
 CONSTRAINT [PK_classified.ClassifiedCustomAttributeValues] PRIMARY KEY CLUSTERED 
(
	[ResourceID] ASC,
	[CategoryID] ASC,
	[AdID] ASC,
	[AttributeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [classified].[ClassifiedAdsCustomAttributeValues]  WITH CHECK ADD  CONSTRAINT [FK_ClassifiedCustomAttributeValues_ClassifiedAttributes] FOREIGN KEY([AttributeID], [CategoryID])
REFERENCES [classified].[ClassifiedAttributes] ([AttributeID], [CategoryID])
GO

ALTER TABLE [classified].[ClassifiedAdsCustomAttributeValues] CHECK CONSTRAINT [FK_ClassifiedCustomAttributeValues_ClassifiedAttributes]
GO


